-- GENERATED SPELL FOR [Grand Astromancer Capernian] --


function spell0_20062(pUnit, Event) --@Arcane Burst,Self--
pUnit:FullCastSpellOnTarget(36970,pUnit)
pUnit:RegisterEvent('Sorts_20062', 9000, 1)
end

function spell1_20062(pUnit, Event) --@Conflagration,n/a--
pUnit:FullCastSpellOnTarget(37018,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20062', 10000, 1)
end

function spell2_20062(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(36971,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20062', 2000, 1)
end

function Sorts_20062(pUnit, Event)
local choix_sorts_20062 = math.random(0, 2)
if choix_sorts_20062 == 0 then
pUnit:RegisterEvent('spell0_20062', 1, 1)
end
if choix_sorts_20062 == 1 then
pUnit:RegisterEvent('spell1_20062', 1, 1)
end
if choix_sorts_20062 == 2 then
pUnit:RegisterEvent('spell2_20062', 1, 1)
end
end

function mob20062_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20062', math.random(1500, 3000), 1)
end

function mob20062_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20062_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20062_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20062, 1, 'mob20062_Action')
RegisterUnitEvent(20062, 2, 'mob20062_Leave')
RegisterUnitEvent(20062, 3, 'mob20062_Kill')
RegisterUnitEvent(20062, 4, 'mob20062_Die')
